import RequestUtils from '@/utils/RequestUtils'

export default {
  /**
   * 新增
   * @param params
   * @returns {AxiosPromise}
   */
  add(params = {}) {
    return RequestUtils({
      url: `/order/quote`,
      method: 'POST',
      data: {
        ...params
      }
    })
  },
  genQuotePpt(params = {}) {
    return RequestUtils({
      url: `/order/quote/genQuotePpt`,
      method: 'POST',
      data: {
        ...params
      }
    })
  },
  genQuoteExcel(params = {}) {
    return RequestUtils({
      url: `/order/quote/genQuoteExcel`,
      method: 'POST',
      data: {
        ...params
      }
    })
  },
  /**
   * 批量删除（多个用逗号隔开）
   * @param ids
   * @returns {AxiosPromise}
   */
  remove(ids) {
    return RequestUtils({
      url: `/order/quote/${ids}`,
      method: 'DELETE'
    })
  },
  /**
   * 修改
   * @param params
   * @returns {AxiosPromise}
   */
  edit(params = {}) {
    return RequestUtils({
      url: `/order/quote`,
      method: 'PUT',
      data: {
        ...params
      }
    })
  },
  /**
   * 详情
   * @param id
   * @returns {AxiosPromise}
   */
  get(id) {
    return RequestUtils({
      url: `/order/quote/${id}`,
      method: 'GET'
    })
  },
  /**
   * 列表
   * @param params
   * @returns {AxiosPromise}
   */
  list(params = {}) {
    return RequestUtils({
      url: `/order/quote/search`,
      method: 'POST',
      data: {
        ...params
      }
    })
  },
  /**
   * 列表-分页
   * @param params
   * @returns {AxiosPromise}
   */
  page(params = {}, page) {
    return RequestUtils({
      url: `/order/quote/search/${page.current}/${page.pageSize}`,
      method: 'POST',
      data: {
        ...params
      }
    })
  },
  /**
   * 我的提案列表-分页
   * @param params
   * @returns {AxiosPromise}
   */
  myQuotePage(params = {}, page) {
    return RequestUtils({
      url: `/order/quote/search/myQuotePage/${page.current}/${page.pageSize}`,
      method: 'POST',
      data: {
        ...params
      }
    })
  },
  /**
   * 发送邮件
   * @returns {AxiosPromise}
   */
  sendMail(params = {}) {
    return RequestUtils({
      url: `/order/quote/sendMail`,
      method: 'POST',
      data: {
        ...params
      }
    })
  },
  /**
   * 导出
   * @param params
   * @returns {AxiosPromise}
   */
  exportData(params = {}) {
    return RequestUtils({
      url: `/order/quote/exportData`,
      method: 'POST',
      data: {
        ...params
      }
    })
  }
}
